#/bin/bash
if [ ! $1 ]; then
	echo "ERROR! input file!"
	exit 1
fi

sed -nr "H; $ {x; s/\n//g; p}" $1 |\
sed -nr "H; $ {x; s///g; p}" | \
sed "/^$/d" > dizhen-xianxue.js

sed "s/var regions=\(.*\)/[\1]/g" dizhen-xianxue.js > dizhen-xianxue.json
